<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all">
    <!--js-->
    <script src="js/jquery-2.1.1.min.js"></script>
    <!--icons-css-->
    <link href="css/font-awesome.css" rel="stylesheet">

    <link rel="stylesheet" href="css/amazeui.css" />
    <link href="css/dlstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="login-banner">
    <div class="login-main">
        <div class="login-banner-bg"><span></span></div>
        <div class="login-box">

            <h3 class="title">登录</h3>

            <div class="clear"></div>
            <!--<form action="login_check" method="post" onsubmit="return check()" name="myForm">-->
            <form method="post" name="myForm">
            <div class="login-form">

                    <div class="user-name">
                        <label for="username" style="position:absolute;display: block;width: 40px;height: 40px;line-height: 40px;background:#fff;text-align: center;top:1px;left:1px"><i class="am-icon-user"></i></label>
                        <input type="text" name="username" id="username" placeholder="邮箱/手机/用户名" style="font-size: 14px;line-height: 18px;height:42px;padding: 11px 8px 11px 50px;width:100%;border:1px solid #fff;">
                    </div>
                    <div class="user-pass">
                        <label for="password" style="position:absolute;display: block;width: 40px;height: 40px;line-height: 40px;background:#fff;text-align: center;top:1px;left:1px"><i class="am-icon-lock"></i></label>
                        <input type="password" name="password" id="password" placeholder="请输入密码" style="font-size: 14px;line-height: 18px;height:42px;padding: 11px 8px 11px 50px;width:100%;border:1px solid #fff;">
                    </div>
                <div class="login-links" style="vertical-align:middle">
                    <label><input type="checkbox" style="display: inline-block">记住密码</label>
                    <!-- <a href="#" class="am-fr">忘记密码</a> -->
                    <input type="button" class="btn btn-info readinfo" style="color:black;background-color: transparent;border: 0px;float: right;" data-id="<%=admin_no%>" data-toggle="modal" data-target="#myModalLabel" value="忘记密码" />
                    <br />
                </div>
                    <div class="am-cf">
                        <input type="button" name="" id="my_button_id1" value="Login" class="am-btn am-btn-primary am-btn-sm">
                    </div>
                    <div class="login-icons">
                        <ul>
                            <li><a href="#" class="facebook"><i class="fa fa-facebook"></i></a></li>
                            <li><a href="#" class="twitter"><i class="fa fa-twitter"></i></a></li>
                            <li><a href="#" class="google"><i class="fa fa-google-plus"></i></a></li>
                            <li><a href="https://cas.dgut.edu.cn?appid=javaee&state=STATE"><i class="fa fa-guangong"></i></a></li>
                        </ul>
                    </div>
            </div>
            </form>
        </div>
    </div>
        <div class="modal fade" id="myModalLabel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content" style="width: 700px">
                    <form  id="change_form" enctype="multipart/form-data" method ="post" >
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title">找回密码</h4>
                        </div>
                        <div class="modal-body">
                            <div class="col-md-9">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label for="number" class="col-sm-4 control-label">账号:*</label>
                                        <div class="col-sm-8">
                                            <input class="form-control change_input" id="number" name="number" type="number">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="as" class="col-sm-4 control-label">发送主题:*</label>
                                        <div class="col-sm-8">
                                            <input class="form-control change_input" id="as" name="as" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="aa" class="col-sm-4 control-label">发送内容:*</label>
                                        <div class="col-sm-8">
                                            <input class="form-control change_input" style="height :200px" id="aa" name="aa" type="text">
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="modal-footer">
                                <div class="center-block">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <input class="btn btn-default mybutton1" value="保存" style="width:55px; display: inline;padding: 6px 12px; background-color: #5bc0de;"
                                           onclick="return check()" type="submit">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
</div>
<script src="js/jquery.nicescroll.js"></script>
<script src="js/scripts.js"></script>
<!--//scrolling js-->
<script src="js/bootstrap.js"> </script>


</body>
</html>
<script>

    $(function () {
        $("#my_button_id1").click(function () {
            var user_name = document.getElementById("username");
            var password = document.getElementById("password");
            // var type = document.getElementById("input3");
            var flag = 1;
            if (user_name.value == "") {
                alert("用户名不能为空!");
                flag = 0;
            }
            else {
                if (password.value == "") {
                    alert("密码不能为空!");
                    flag = 0;
                }
                if (flag == 1) {
                    $.get(
                        "/login_check",
                        {username:user_name.value, password:password.value},
                        function (data) {
                            var exit = data.exit;
                            if (exit == 2) {
                                alert("该用户名不存在或密码错误");
                            }
                            else {
                                // alert("登陆成功，点击确认后前往用户页面");
                                window.location.href = "index.jsp";
                            }
                        }
                    );
                }
            }
        });
    });

</script>
